function ratWeights
close all
d={};

%http://www.criver.com/SiteCollectionDocuments/rm_rm_c_long_evans_rats.pdf
%   grams     male day range    female day range
d{end+1}={...
    [51 75]    [22 25]           [22 26]; ...
    [76 100]   [26 29]           [27 31]; ...
    [101 125]  [30 34]           [32 36]; ...
    [126 150]  [35 37]           [37 43]; ...
    [151 175]  [38 42]           [44 50]; ...
    [176 200]  [43 46]           [51 55]; ...
    [201 225]  [47 49]           [56 69]; ...
    [226 250]  [50 55]           [70 86]; ...
    [251 275]  [56 58]           [87 102]; ...
    [276 300]  [59 64]           []; ...
    [301 325]  [65 70]           []; ...
    [326 350]  [71 80]           []; ...
    [351 375]  [81 90]           []};

%http://www.harlan.com/models/longevans.asp
%note table does not match graph!  ex: male 10 weeks is >300 in graph, but <300 in table!
%   grams     male         female
d{end+1}={...
    [35 49]    [20 23]      [20 24]; ...
    [50 74]    [24 29]      [25 30]; ...
    [75 99]    [30 33]      [31 35]; ...
    [100 124]  [34 37]      [36 41]; ...
    [125 149]  [38 41]      [42 49]; ...
    [150 174]  [42 45]      [50 56]; ...
    [175 199]  [46 49]      [57 69]; ...
    [200 224]  [50 57]      [70 89]; ...
    [225 249]  [58 64]      [90 110]; ...
    [250 274]  [65 70]      []; ...
    [275 299]  [71 79]      []; ...
    [300 324]  [80 90]      []; ...
    [325 349]  [91 100]     []; ...
    [350 374]  [101 110]    []...
    };

%http://jn.nutrition.org/cgi/reprint/100/1/59.pdf
%table 1 control
%day       male    sem     female  sem
% [30 30]    [72     4.2]    [64.7   2.1]
% [60 60]    [189.5  6.0]    [154.2  6.0]
% [90 90]    [270    8.9]    [197.1  5.4]
% [120 120]  [312    9.3]    [225.2  5.3]
% [150 150]  [341.5  8.9]    [238.8  4.0]
% [180 180]  [364.7  8.7]    [250.5  4.9]
% [360 360]  [443.8  14.9]   [262.6  5.9]
% [540 540]  [507.4  16.4]   [262.4  9.8]
d{end+1}={...
    [72 72]       [30 30]   []; ...
    [189.5 189.5] [60 60]   []; ...
    [270 270]     [90 90]   []; ...
    [312 312]     [120 120] []; ...
    [341.5 341.5] [150 150] []; ...
    [364.7 364.7] [180 180] []; ...
    [443.8 443.8] [360 360] []; ...
    [507.4 507.4] [540 540] []; ...
    [64.7 64.7]   []        [30 30]; ...
    [154.2 154.2] []        [60 60]; ...
    [197.1 197.1] []        [90 90]; ...
    [225.2 225.2] []        [120 120]; ...
    [238.8 238.8] []        [150 150]; ...
    [250.5 250.5] []        [180 180]; ...
    [262.6 262.6] []        [360 360]; ...
    [262.4 262.4] []        [540 540]...
    };

figure
for i=1:length(d)
    for j=1:size(d{i},1)

        if ~isempty(d{i}{j,3})
            for k=d{i}{j,3}(1):d{i}{j,3}(2)
                for m=d{i}{j,1}(1):d{i}{j,1}(2)
                    plot(k,m,'rx')
                    hold on
                end
            end
        end

        if ~isempty(d{i}{j,2})
            for k=d{i}{j,2}(1):d{i}{j,2}(2)
                for m=d{i}{j,1}(1):d{i}{j,1}(2)
                    plot(k,m,'bx')
                    hold on
                end
            end
        end

    end
end

ylabel('grams')
xlabel('day')

t=.85;
c=dbconn;
ids={'106','177'};
[blah maleD maleT] = getBodyWeightHistory(c,ids{1});
[blah femaleD femaleT] = getBodyWeightHistory(c,ids{2});
s=getSubjects(c,ids);
closeconn(c);
if s(1).gender=='M' && s(2).gender=='F'
    plot(maleD-s(1).dob,maleT/t,'b')
    hold on
    plot(femaleD-s(2).dob,femaleT/t,'r')
else
    error('bad genders')
end